home *** CD-ROM | disk | FTP | other *** search
/ Aminet 4 / Aminet 4 - November 1994.iso / aminet / dev / c / appsource.lha / APlusPlus / GNUC++ / APPLibrary / makegnu < prev   
Encoding:
Text File  |  1994-08-27  |  2.3 KB  |  90 lines

  1. #
  2. # This script creates a makefile for A++ to be executed
  3. # with GNU Make and the GNU/C++ Development System.
  4. #
  5.  
  6. # open the output file
  7. echo "Creating GNU 'makefile'.."
  8. rm makefile
  9. open makefile w 1
  10.  
  11. echo "#"^j\
  12. "# GNU Makefile for the A++ Library"^j\
  13. "# Copyright (C) by Armin Vogt"^j\
  14. "#"^j\
  15. "# This makefile has been created automatically with 'makegnu'"^j\
  16. "# "$Id: makegnu,v 1.2 1994/08/02 18:58:47 Armin_Vogt Exp Armin_Vogt $^j\
  17. "#"^j^j\
  18. "VPATH           =      /apphome/libsource"^j\
  19. "INCDIR          =      /appinclude"^j\
  20. "APPHEADER       =      /appinclude/APlusPlus"^j\
  21. ^j"#"^j"# if the Commodore® headers are not present in gcc:os-include"^j\
  22. "# define their path here.."^j\
  23. "CHEADERS        =      /include"^j\
  24. ""^j\
  25. ""^j\
  26. "CC      =  gcc"^j\
  27. "CFLAGS  =  -O2"^j\
  28. "AR      =  ar"^j\
  29. "RANLIB  =  ranlib"^j\
  30. ^j\
  31. "LIBRARYFILE =    libaplusplus.a"^j^j\
  32. "ERRORPIPE   =  pipe:gnu_errors"^j\
  33. ""^j >.1
  34.  
  35.  
  36. alias ALL        "*p%c exec set p $p; foreach s ( $p ) $c"
  37.  
  38. echo "Making object lists.."
  39. #
  40. # create object list: all files present in the libsource directory
  41. # are included.
  42. #
  43. echo "OBJS =  \\" >.1
  44. cd apphome:libsource
  45. unset file
  46. ALL *.cxx "strhead file .cxx $s;echo \" \"$file.o\\\\" >.1
  47. echo ^j^j >.1
  48. dswap
  49.  
  50. #
  51. # IMPORTANT NOTE: GNU Make demands a tab character leading each
  52. # action line!! '^i' prints a tab.
  53. #
  54.  
  55. echo ".SUFFIXES: .o .c .cxx"^j >.1
  56. echo ".cxx.o:"^j\
  57. ^i"$(CC) -c -I/gcc/include -I$(INCDIR) -I$(CHEADERS) $(CFLAGS) $< >$(ERRORPIPE)"^j >.1
  58.  
  59. echo ^j"# The order of include directory declarations in crucial when"^j\
  60. "# CHEADERS is used. GNU standard headers must have a higher priority"^j\
  61. "# than the ones in the CHEADERS (usually SAS standard headers!!)"^j >.1
  62.  
  63. echo "all : $(LIBRARYFILE)"^j^j\
  64. "$(LIBRARYFILE): $(OBJS)"^j\
  65. ^i"$(AR) crv $(LIBRARYFILE) $?"^j\
  66. ^i"$(RANLIB) $(LIBRARYFILE)"^j >.1
  67.  
  68.  
  69.  
  70. #
  71. # create object's source and header dependencies: for each files
  72. # present in the header directories a dependency is created.
  73. # Even if the header does not correspond to a source file,
  74. # that doesn't matter since only source files are included into
  75. # the objects list.
  76. #
  77.  
  78. echo "Making A++ source dependencies.."
  79.  
  80. echo ^j^j"#"^j"# A++ dependencies"^j"#"^j >.1
  81. cd appinclude:APlusPlus
  82. unset file
  83. unset name
  84. ALL */*.h "strhead file .h $s;strtail name / $file;echo "$name.o: $name.cxx "\"$\""(APPHEADER)/$file.h"^j;" >.1
  85. dswap
  86.  
  87. # close created output file
  88. close 1
  89. echo "done."
  90.